<?php
namespace App\Modules\Health\Models;

use Dcat\Admin\Traits\HasDateTimeFormatter;
use Illuminate\Database\Eloquent\Model;

class Disease extends Model
{
    use HasDateTimeFormatter;

    protected $table = 'health_disease';

    protected $primaryKey = 'id';

    protected $fillable = [
        'class_id', // 分类id
        'name', // 名称
        'img', // 图片
        'introduce', // 介绍
        'treat_details', // 调理详情
        'clinical_experience', // 临床体会
        'case', // 相关案例
    ];

    public function class()
    {
        return $this->hasOne(DiseaseClass::class, 'id', 'class_id');
    }

    public function scheme()
    {
        return $this->hasMany(DiseaseScheme::class, 'disease_id', 'id');
    }
}
